package com.atguigu.srb.core.service.impl;

import com.atguigu.srb.core.mapper.ClubRegistrationMapper;
import com.atguigu.srb.core.mapper.CommunityInformationMapper;
import com.atguigu.srb.core.pojo.entity.ClubRegistration;
import com.atguigu.srb.core.pojo.entity.CommunityInformation;
import com.atguigu.srb.core.service.ClubRegistrationService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public  class ClubRegistrationServiceImpl extends ServiceImpl<ClubRegistrationMapper, ClubRegistration> implements ClubRegistrationService {




    @Resource
    ClubRegistrationMapper clubRegistrationMapper;

    @Resource
    CommunityInformationMapper communityInformationMapper;
    @Override
    public List<ClubRegistration> getByNumber(String id){

        List<ClubRegistration> clubList = clubRegistrationMapper.getClubList(id);
        return  clubList;


    }

    @Override
    public boolean updatecommunityinformation(CommunityInformation communityInformation) {
        try {
            CommunityInformation communityInformation1 =communityInformationMapper.selectById(communityInformation.getCommunityInformationId());

            communityInformation1.setClubAvatar(communityInformation.getClubAvatar());
            communityInformation1.setCommunityAddress(communityInformation.getCommunityAddress());
            communityInformation1.setCommunityProfile(communityInformation.getCommunityProfile());
            communityInformation1.setClubAvatar(communityInformation.getClubAvatar());

            return true;
        }catch (Exception e)
        {
            return false;
        }
    }
}
